import request from '@/utils/request'



// 分页查询role列表
export function listRoleByPage(query) {
  return request({
    url: '/role/page',
    method: 'post',
    data: query
  })
}

// 通过id查询role
export function getRole(roleId) {
  return request({
    url: '/role/' + roleId,
    method: 'get'
  })
}

// 新增role
export function addRole(data) {
  return request({
    url: '/role/save',
    method: 'post',
    data: data
  })
}

// 修改role
export function updateRole(data) {
  return request({
    url: '/role/update',
    method: 'post',
    data: data
  })
}

// 删除role
export function deleteRole(id) {
  return request({
    url: '/role/delete/',
    method: 'post',
    data: id
  })
}

// 授权菜单
export function authMenu(data) {
  return request({
    url: '/role/authRole',
    method: 'post',
    data: data
  })
}